package com.example.springboot.demo.nacos.configuration;

import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.client.config.NacosConfigService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Properties;

/**
 * @Author dengkaibing
 * @Date 2023/4/6 18:11
 * @Desc nacos配置
 */
@Configuration
public class NacosConfiguration {


    /**
     * nacos配置
     */
    @Bean
    public NacosConfigService   initNacosConfig() throws NacosException {
        Properties properties = new Properties();
        properties.put("serverAddr", "");
        properties.put("namespace", "");
        NacosConfigService nacosConfigService = new NacosConfigService(properties);
        return nacosConfigService;
    }

}
